package penguin.masking;

/**
 * 提供数据恢复
 *
 * @author wuxh
 * @version 1.0.0
 */
public class DataReductionService {

    /**
     * 数据恢复
     *
     * @param v
     * @return
     */
    public static String reduction(String v) {
        DataMaskingProcess maskingProcess = MaskingContext.context().getMaskingProcess();
        if (maskingProcess == null) {
            return v;
        }
        return maskingProcess.doReduction(v);
    }

    /**
     * 数据恢复
     *
     * @param v
     * @return
     */
    public static Object reduction(Object v) {
        DataMaskingProcess maskingProcess = MaskingContext.context().getMaskingProcess();
        if (maskingProcess == null) {
            return v;
        }
        return maskingProcess.doReduction(v);
    }
}
